import static com.googlecode.javacv.cpp.opencv_highgui.cvLoadImage;
import static com.googlecode.javacv.cpp.opencv_highgui.cvSaveImage;
import static com.googlecode.javacv.cpp.opencv_imgproc.CV_GAUSSIAN;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvSmooth;
import static com.googlecode.javacv.cpp.opencv_highgui.*;

import java.io.File;

import com.googlecode.javacv.JavaCvErrorCallback;
import com.googlecode.javacv.cpp.opencv_core.IplImage;

public class Smoother {
    public  void smooth(String filename) { 
//        IplImage image = cvLoadImage(filename,CV_LOAD_IMAGE_COLOR);
    	IplImage image = cvLoadImage(filename,0);
        if (image != null) {
//        	image.
            cvSmooth(image, image, CV_GAUSSIAN, 3);
            cvSaveImage("new.jpg", image);
        }
        else
        	System.out.println("asdf");
    }
    public static void main(String[] args) {
//    	Integer a=1;
//    	ImageIcon 	icon = new ImageIcon(a.getClass().getResource("/funnel.png"), "");
    	String filename="horario.png";
//        File imageFile = new File(filename);
//        if(!imageFile.exists()) {
//                throw new RuntimeException("Image file " + filename + " not found.");
//        }
    	Smoother a=new Smoother();
		a.smooth(filename);
	}
}